(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.jobGroup.testSchdListController', testSchdListController);
	testSchdListController.$inject = [ '$scope', '$q', '$uibModalInstance', 'Constants', 'dialogsModule', 'gridService', 'modalService', 'layoutConfig', 'validatorConfig', 'authService'];
	function testSchdListController($scope, $q, $uibModalInstance, Constants, dialogsModule, gridService, modalService, layoutConfig, validatorConfig, authService) {
		var ctrl = this, log = $scope.loggerFactory.getLogger("testSchdListController");
		ctrl.dialogsModule = dialogsModule;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		
		ctrl.ok = function() {
			if (!dialogsModule.btnCallback || !dialogsModule.btnCallback['ok'] || dialogsModule.btnCallback['ok'](ctrl.selectedRows) !== false) {
				$uibModalInstance.close();
			}
		};
		
		ctrl.close = function() {
			if (!dialogsModule.btnCallback || !dialogsModule.btnCallback['close'] || dialogsModule.btnCallback['close']() !== false) {
				$uibModalInstance.dismiss();
			}
		};
		
		ctrl.init = function() {
			ctrl.innerGridOptions = gridService.createInnerGridOptions($scope, ctrl.layoutConfig.tableConfigs.table);
			ctrl.innerGridOptions.data = 'vm.runTimeList';
			ctrl.innerGridOptions.enableRowHeaderSelection = false;
			if(dialogsModule.params && dialogsModule.params.runTimeList){
				ctrl.runTimeList = dialogsModule.params.runTimeList;
			}
		};
	}
})(angular);